<!DOCTYPE html>
<html lang="en">
<head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <title>工程建筑ERP登录</title>
    <link rel="stylesheet" href="../resources/layui/css/layui.css">
    <style>
        html,body{padding: 0;margin: 0;width: 100%;height: 100%; background: url("../resources/images/denglus.jpg") no-repeat center;background-size:cover;}
        /*html,body{padding: 0;margin: 0;width: 100%;height: 100%;background-color: #67e5f7;}*/
        html{font-size: 100px;}
        ul,li{list-style: none;}
        a{text-decoration: none;}
        body{position: relative;}
        .main{width:600px; height: 350px; position: fixed;left: 0;right: 0;top: 0;bottom: 0;margin: auto;}
        .mainL,.mainR{float: left;height: 100%;}
        .mainL{width: 100%;background-size: 100%;background-color: rgba(255,255,255,.8);border-radius:10px;}
        .mainR{width: 40%;background-color: #FFF;}
        .mainRon{margin: .38rem .52rem .2rem .6rem;}
       .gongnames{height: 70px;width: 100%;font-size: 30px;text-align: center;color: #333333; /*-webkit-text-stroke: 2px #FFF;*/ }
        .dengluONs{height: .55rem;line-height: .55rem;margin-bottom: .1rem;}
        .dengluONs span{ color:#333;font-size: .2rem;width: 0.8rem;display: inline-block; text-align: right;
            padding-right:0.2rem;}
        .layui-input{width: 3.2rem;display: inline-block;border: 0; background-color: #f5f5f5}
        .layui-input:focus{ background-color: #f5f5f5;}
        .yanzheng{width: 1.6rem;}
        .mainRB{width: 100%;text-align: center;}
        .dengluONs{position: relative;text-align: center;}
        .dengluONs a{width: .5rem; display: inline-block;line-height: .15rem;position: absolute;top: .15rem; right:
                .5rem;}
        .mainRB button{color: #FFF!important;}
        @media screen and (max-width: 1200px) {
            html{font-size: 86px;}

        }
        @media screen and (max-width: 750px) {
            html{font-size: 66px;}
            .mainL {
                display: none;
            }
            .dengluONs a{width: 100%; text-align: right;position:static; }
            .dengluONs:nth-child(3){margin-bottom: .6rem;}
            .gongnames{background-size: 100%;}
        }

        *.yanzhengs {
            -moz-user-select: -moz-none;
            -khtml-user-select: none;
            -webkit-user-select: none;
            /*
              Introduced in IE 10.
              See http://ie.microsoft.com/testdrive/HTML5/msUserSelect/
            */
            -ms-user-select: none;
            user-select: none;
        }
        span.yanzhengs{display: inline-block; width: 80px; height:36px;
            border: 1px solid #EEE; position: absolute;margin-left: 10px;
            margin-top: 10px; padding-right:0;line-height: 36px; text-align: center;font-size: 20px;}
        .zhuce{  text-align:center;border-left:1px solid #e3e3e3;font-size: 16px; height: 4rem; margin: 0.5rem
        auto;}
        .zhuce img{width:140px; height: 140px;}
        .zhuce dt{ color: #999; line-height: 30px; padding-top: 60px;}
        .zhuce dt a{ color: #029686;}
        .zhuce dd{  line-height: 40px; }
        .mainRB button{border-radius: 4px;}
        input:-webkit-autofill {
            -webkit-box-shadow: 0 0 0px 1000px white inset !important;
        }
    </style>

</head>
<body>
<div class="main">
    <div class="mainL">
        <form class="layui-form" action="">
            <div class="mainRon">
                <div class="gongnames">砼鑫ERP缴费管理系统</div>
                <div class="dengluOn">
                    <div class="dengluONs">
                        <span class="names">账号</span>
                        <input type="text" name="uname" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input names">
                    </div>
                    <div class="dengluONs">
                        <span class="mima">密码</span>
                        <input type="password" name="upwd" lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input mimas">
                    </div>
                </div>

            </div>

            <div class="mainRB">
                <button class="layui-btn layui-btn-primary layui-btn-lg tijiao" type="button" lay-submit lay-filter="_subm" style="background-color: #2d8cf0;border-color:#2d8cf0;">登录</button>
                <button class="layui-btn layui-btn-primary layui-btn-lg" type="reset" style="color: #555!important;">重置</button>
            </div>

        </form>

    </div>

</div>


<script src="../resources/js/jquery.js"></script>
<script src="../resources/layui/layui.all.js"></script>
<script src="../resources/js/api.js"></script>
<script>

    var arrs='';

    layui.use(['form', 'layedit', 'laydate','table','element','upload'], function() {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate
            , table = layui.table
            , element = layui.element
            , upload = layui.upload;

        //自定义验证规则
        form.verify({
            title: function(value){
                if(value.length < 5){
                    return '标题至少得5个字符啊';
                }
            }
            ,mima: [/(.+){6,12}$/, '密码必须6到12位']

            ,pass: [/(.+){4,4}$/, '请输入正确的验证码']
            ,content: function(value){
                layedit.sync(editIndex);
            }
        });

        var arrs=new Array();
        var arrtow=new Array();
        //提交监听
        form.on('submit(_subm)',function (data) {
            var yanZ=$('.yanzhengs').text();

            var index = layer.load(5); //换了种风格
            var _Width=$(window).width();
            var _List=_Width*.5;
            $('.layui-layer-loading').css('left',_List)
            console.log(data.field)
            Btnon('.tijiao')
            sessionStorage.ZQXdata='';

            $.ajax({
                type:'post',
                url:urls+'/api/user/aLogin.do',
                data:data.field,
                success:function (res) {
                    console.log(res)
                    layer.close(index);
                    if(res.code==0){
                        setCookie('yanzheng',res.data.uname)

                        var datas=res.fullDown;
                        $.each(datas,function (k,v) {
                            $.each(v,function (k1,v1) {
                                arrs.push(v1.url);
                                arrtow.push(v1.api);
                            });
                        });
                        arrs=arrs.join(',');
                        sessionStorage.ZQXdata=arrs;
                        sessionStorage.jiekou=arrtow;
//                        console.log(arrtow)
                        location.href='./adminson/admins.html';
                    }else if(res.code==1){
                        layer.msg(res.msg);
                        Btnoff('.tijiao');      //开放 按钮点击
                    }else{
                        layer.msg(res.msg);
                        Btnoff('.tijiao');       //开放 按钮点击
                    }
                },
                error:function (data) {
                    layer.close(index);
                    layer.msg('系统错误');
                    Btnoff('.tijiao');      //开放 按钮点击
                }
            })
            return false;
        })


    })
</script>
</body>
</html>